package fr.cephb.lexyacc;

/** A node containing simple object e.g. String, Long, etc... */
public class ScalarNode<T> extends Node {
	private T object;
	/** constructor with the object to wrap */
	public ScalarNode(T object)
		{
		this.object=object;
		}
	
	/** return the wrapped object */
	public T getObject() {
		return object;
		}
	
	public String getName()
		{
		return "<scalar>";
		}
	/** return the wrapped object */
	@Override
	public Object eval(Context ctx)
		{
		return getObject();
		}
	
	@Override
	public String toString() {
		return getObject().toString();
		}

}
